{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("filter/reply_document.xml")-->
<!--%import("js/mkin.js")-->
<!--%import("css/mkin.css")-->
<div class="bd">
	<div class="rd">
		<div class="hx h2">
			<h2><a href="{getUrl('document_srl','','category','','page','')}">{$module_info->browser_title}</a> 
				<!--@if($module_info->use_category == "Y" && $oDocument->get('category_srl'))-->&rsaquo; <a href="{getUrl('document_srl','','category',$oDocument->get('category_srl'))}">{$categories[$oDocument->get('category_srl')]->title}</a><!--@end--> 
				&rsaquo; {$oDocument->getTitle()}
			</h2>
			<span class="ex">
				{$oDocument->getNickName()} | {$oDocument->getRegdate()} | <a href="#skip_co">본문 건너뛰기</a>
			</span>
			<a href="{getUrl('act','dispKinWrite','document_srl','')}" class="write">{$lang->cmd_ask}</a>
		</div>
		<div class="co">
			{$oDocument->getContent(false)}
			<div class="op">
				<span class="fl"><a href="#replies_{$oDocument->document_srl}" onclick="doGetComments({$oDocument->document_srl}); return false;" id="replies_{$oDocument->document_srl}">{$lang->short_replies}</a> ({number_format($replies_count[$oDocument->document_srl])})</span>
				<span class="fr">{$lang->give_point} : {$oDocument->get('point')} {$point_name}</span>
			</div>
			<div class="opl" id="replies_content_{$oDocument->document_srl}" style="display:none;"></div>
		</div>
		<div id="skip_co"></div>
		<!--@if($oDocument->hasUploadedFiles())-->
		{@ $uploaded_list = $oDocument->getUploadedFiles() }
		<div class="hx h3">
			<h3>{$lang->uploaded_file} <em>[{count($uploaded_list)}]</em></h3>
			<button type="button" class="tg" title="open/close"></button>
		</div>
		<ul class="tgo open">
			<!--@foreach($uploaded_list as $key => $file)-->
			<li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename}</a></li>
			<!--@end-->
		</ul>
		<!--@endif-->

		<!--@if($oDocument->allowComment() && $oDocument->getCommentCount())-->
		<div class="hx h3">
			<h3 id="clb">{$lang->replies} <em>[{$oDocument->getCommentCount()}]</em></h3>
			<button type="button" class="tg tgr" title="open/close"></button>
		</div>
		<!--@endif-->
		<!--@if($grant->write_reply && $oDocument->isEnableComment() )-->
		<div class="hx h3">
			<h3>{$lang->cmd_reply}</h3>
			<button type="button" class="tg" title="open/close"></button>
		</div>
		<form action="./" method="post" class="ff tgo open" onsubmit="return procFilter(this, reply_document);">
		<input type="hidden" name="mid" value="{$mid}" />
		<input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
		<input type="hidden" name="comment_srl" value="{$oReply->get('comment_srl')}" />
		<ul>
			<li>
				<label for="rText">{$lang->cmd_reply}</label>
				<textarea name="content" cols="20" rows="5" id="rText"></textarea>
			</li>
		</ul>
		<div class="bna">
			<input name="" type="submit" value="{$lang->cmd_reply}" class="bn dark" />
		</div>
		</form>
		<!--@end-->
	</div>
</div>
<script type="text/javascript">
//<![CDATA[
jQuery(function($){
	$('.tgo').removeClass('open');
	$('.tg').click(function(){
		$(this).parents('.h3:first').next('.tgo').toggleClass('open');
	});
	var loaded = false;
	$('.tgr').click(function(){
		if(!loaded) {
			loaded = true;
			{@ $lastpage = 1; }
			{@ $temp = $oDocument->getComments() }
			<!--@if($oDocument->comment_page_navigation)-->
			{@ $lastpage = $oDocument->comment_page_navigation->last_page }
			<!--@endif-->
			loadPage({$oDocument->document_srl}, {$lastpage});
		}
	});
});
//]]>
</script>
